using System;
using System.Collections;
using System.Configuration;
using System.Xml;

namespace Concurso.Clases
{
	/// <summary>
	/// Summary description for UserHandler.
	/// </summary>
	public class RoleHandler : IConfigurationSectionHandler
	{
		public RoleHandler()
		{
			//
			// TODO: Add constructor logic here
			//
		}
		public object Create(object parent, object configContext, System.Xml.XmlNode section)
		{
			IList roles = null;

			if (section == null) { return roles; }
			roles = new ArrayList();
			//Walk the sections' child nodes, reading the elements
			foreach (XmlNode node in section.ChildNodes)
			{
				string roleName = node.Attributes["name"].InnerText;
				roles.Add(roleName);
			}

			return roles;
		}
	}
}
